//
//  FinancialSecitonHeaderView.m
//  BaseFrame
//
//  Created by 于洋 on 2017/8/12.
//  Copyright © 2017年 com.mxh. All rights reserved.
//

#import "FinancialSecitonHeaderView.h"
@interface FinancialSecitonHeaderView ()
@property (nonatomic,strong)UILabel *title;
@property (nonatomic,strong)UILabel *drawState;
@property (nonatomic,strong)UILabel *content;
@property (nonatomic,strong)UIView *bgView;
@end
@implementation FinancialSecitonHeaderView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = getColor(@"ebebf1");
        _bgView = [[UIView alloc] initWithFrame:CGRectMake(5/WIDTH_5S_SCALE, 0, SCREEN_WIDTH-10/WIDTH_5S_SCALE, 35/WIDTH_5S_SCALE)];
        _bgView.backgroundColor = [UIColor whiteColor];
        [self addSubview:self.bgView];
        
        _title = [[UILabel alloc] initWithFrame:CGRectMake(5, 0, 80/WIDTH_5S_SCALE, _bgView.frame.size.height)];
        _title.font = DEF_FontSize_15;
        _title.textColor = getColor(mainColor);
        _title.textAlignment = NSTextAlignmentLeft;
        [self.bgView addSubview:self.title];
        
        _drawState = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_title.frame), 0, 60/WIDTH_5S_SCALE, _bgView.frame.size.height)];
        _drawState.font = DEF_FontSize_14;
        _drawState.textColor = [UIColor redColor];
        _drawState.text = @"(已提现)";
        _drawState.textAlignment = NSTextAlignmentLeft;
        [self.bgView addSubview:self.drawState];
        
        _content = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_drawState.frame), 0, _bgView.frame.size.width - 150/WIDTH_5S_SCALE, _bgView.frame.size.height)];
        _content.font = DEF_FontSize_15;
        _content.textColor = getColor(mainColor);
        _content.textAlignment = NSTextAlignmentRight;
        [self.bgView addSubview:self.content];
        

        
    }
    return self;
}

- (void) setTitle:(NSString *)title content:(NSString *)content drawState:(BOOL)state{
    _title.text = title;
    _content.text = content;
    if(!state){
        _drawState.hidden = YES;
    }
}

@end
